package com.gjy.test.other;

import java.time.LocalDate;
import java.time.chrono.ChronoLocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2022-12-05 10:18:42
 */
public class T2 {

    private static final DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyyMMdd");

    public static void main(String[] args) {

        LocalDate now = LocalDate.now();
        boolean after = now.isBefore(ChronoLocalDate.from(pattern.parse("20221205"))
                .plus(1, ChronoUnit.DAYS));
        boolean before = now.isAfter(ChronoLocalDate.from(pattern.parse("20221205"))
                .minus(1, ChronoUnit.DAYS));

        System.out.println("before = " + before);
        System.out.println("after = " + after);
    }
}
